<template>
  <div class="main-header">
    <div class="menu-icon">
      <el-icon size="26px" @click="handleMenuIconClick()">
        <component :is="isFold ? 'expand' : 'fold'"></component>
      </el-icon>
    </div>
    <div class="content">
      <div class="breadcrumb">
        <header-crumb></header-crumb>
      </div>
      <header-info></header-info>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import HeaderInfo from '@/components/main-header/c-cpns/header-info.vue'

const emit = defineEmits(['foldChange'])
const isFold = ref(false)

function handleMenuIconClick() {
  isFold.value = !isFold.value
  emit('foldChange', isFold.value)
}
</script>

<style lang="less" scoped>
.main-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  .menu-icon {
    display: flex;
    align-items: center;
    cursor: pointer;
  }
  .content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    flex: 1;
  }
}
</style>
